package com.tg.service.childProperty;

import com.tg.contract.dto.RibbonMessage;
import com.tg.service.child.config.ChildPropertyConfig;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@Import({ChildPropertyConfig.class})
public class ChildPropertyMain {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ChildPropertyMain.class, args);

        ChildPropertyConfig config = context.getBean(ChildPropertyConfig.class);

        /**
         * 当母体模块application指定配置child.pro，使用母体模块的application.properties的配置，并覆盖子模块的配置
         * 否则，使用子模块的child.properties
         */
        System.out.println(config);
    }
}
